import axios from "axios";
import qs from "qs";


// 查询所有服务及对应的服务员
export async function showAll(page,limit){
    var resp = await axios.get(
     "/api/pets_sys_hou_1/service.do",{
        params:{
            method:"service_page",
            page,
            limit
        }
    });
    return resp;

}

// 条件查询
export async function queryService(page,limit,serviceName){
    console.log(serviceName)
    var resp = await axios.get(
     "/api/pets_sys_hou_1/service.do",{
        params:{
            method:"service_query",
            serviceName:serviceName,
            page,
            limit
        },
        
 
    });
    return resp;

}

// 查询所有的服务员
export async function getStaffs(){
    var resp = await axios.get(
     "/api/pets_sys_hou_1/service.do",{
        params:{
            method:"staff_show",

        }
    });
    return resp.data;

}

// 添加服务
export async function addService(service){
    var resp = await axios.get(
     "/api/pets_sys_hou_1/service.do",{
        params:{
            method:"service_add",
            serviceName:service.serviceName,
            serviceWeight:service.serviceWeight,
            serviceUsetime:service.serviceUsetime,
            serviceTime:service.serviceTime,
            fkStaffId:service.staffId,
            // fkStaffId:value,

            serviceFix:service.serviceFix,
            servicePrice:service.servicePrice
        }
    });
    return resp;
}

// 删除服务
export async function DelService(serviceId){
    var resp = await axios.get(
     "/api/pets_sys_hou_1/service.do",{
        params:{
            method:"service_del",
            serviceId:serviceId
        }
    });
    return resp;
}

// 修改服务
export async function updateService(service){
    var resp = await axios.get(
     "/api/pets_sys_hou_1/service.do",{
        params:{
            method:"service_update",
            serviceId:service.serviceId,
            serviceName:service.serviceName,
            serviceWeight:service.serviceWeight,
            serviceUsetime:service.serviceUsetime,
            serviceTime:service.serviceTime,
            fkStaffId:service.staffId,
            serviceFix:service.serviceFix,
            servicePrice:service.servicePrice
        }
    });
    return resp;
}